'use strict'
  class ContentService {
    constructor(rpc_client) {
      this.rpc_client = rpc_client
    }
    /**
    * 上传视频
    * @params oVideoInfo 视频信息
    * @params shopId 店铺Id
    * @params videoType 视频类型
    * @return
    */
    uploadVideo(oVideoInfo, shopId, videoType) {
      return this.rpc_client.request("eleme.content.uploadVideo", {
        oVideoInfo: oVideoInfo,
        shopId: shopId,
        videoType: videoType,
      })
    }
    /**
    * 获取efs配置
    * @params videoType 视频类型
    * @return
    */
    getEfsConfig(videoType) {
      return this.rpc_client.request("eleme.content.getEfsConfig", {
        videoType: videoType,
      })
    }
    /**
    * 建立视频与相对应的业务的关联关系
    * @params videoId 视频Id
    * @params bizId 业务Id
    * @params bindBizType 业务类型
    * @return
    */
    setVideoBindRelation(videoId, bizId, bindBizType) {
      return this.rpc_client.request("eleme.content.setVideoBindRelation", {
        videoId: videoId,
        bizId: bizId,
        bindBizType: bindBizType,
      })
    }
    /**
    * 取消视频与对应业务的关联关系
    * @params videoId 视频Id
    * @params bizId 业务Id
    * @params bindBizType 业务类型
    * @return
    */
    unsetVideoBindRelation(videoId, bizId, bindBizType) {
      return this.rpc_client.request("eleme.content.unsetVideoBindRelation", {
        videoId: videoId,
        bizId: bizId,
        bindBizType: bindBizType,
      })
    }
    /**
    * 通过视频id查询视频信息
    * @params videoId 视频Id
    * @return
    */
    getVideoInfo(videoId) {
      return this.rpc_client.request("eleme.content.getVideoInfo", {
        videoId: videoId,
      })
    }
    /**
    * 通过视频id获取所有相关联的业务关系
    * @params videoId 视频Id
    * @return
    */
    getVideoBindInfo(videoId) {
      return this.rpc_client.request("eleme.content.getVideoBindInfo", {
        videoId: videoId,
      })
    }
}

module.exports = ContentService